# -*- coding: UTF-8 -*-
# server_assets
# @File : zhanyi.py
# @Date : 2023-08-30
# @Author  : wuzhouhai
# @Desc:
import KBEngine
from KBEDebug import *

def zhangjieFight(dynamicId, characterId, fightType, bossGuanQia,
                  teamMemberList, teamFightGuanQia, teamFightDifficulty):
    """章节战斗
    """
    # player = PlayersManager().getPlayerByID(characterId)
    # if not player or not player.CheckClient(dynamicId):
    #     msgResult = guaji_pb2.MsgFightResult()
    #     msgResult.Result = 'FALSE'
    #     msgResult.ResultInfo = u'连接错误'
    #     return msgResult.SerializePartialToString()

    # check = player.updateHeartTick(fightType)#更新心跳时间
    # if not check:
    #     player.updatePlayerDBInfo()
    #     PlayersManager().dropPlayer(player)
    #     msgResult = guaji_pb2.MsgFightResult()
    #     msgResult.Result = 'FALSE'
    #     msgResult.ResultInfo = u'战斗请求频繁'
    #     return msgResult.SerializePartialToString()

    # if fightType == 2 and player.zhanyi.getFightBossTimes() <= 0:
    #     msgResult = guaji_pb2.MsgFightResult()
    #     msgResult.Result = 'FALSE'
    #     msgResult.ResultInfo = u'今日次数已经用完'
    #     return msgResult.SerializePartialToString()
    # if fightType == 4:
    #     if not WorldManager().checkWorldBossOpen() or not WorldManager().getWorldBoss():
    #         msgResult = guaji_pb2.MsgFightResult()
    #         msgResult.Result = 'FALSE'
    #         msgResult.ResultInfo = u'未开启世界BOSS'
    #         return msgResult.SerializePartialToString()
    #     return  player.zhanyi.doWorldBoss(fightType)
    # elif fightType == 6:
    #     return player.fightTower.doTowerFight(fightType)
    # elif fightType == 7:
    #     if player.zhanyi.getTeamFightTimes() <= 0:
    #         msgResult = guaji_pb2.MsgFightResult()
    #         msgResult.Result = 'FALSE'
    #         msgResult.ResultInfo = u'今日次数已经用完'
    #         return msgResult.SerializePartialToString()
    #     return player.zhanyi.doTeamFight(fightType,teamMemberList,teamFightGuanQia,teamFightDifficulty)
    # elif fightType == 8:
    #     return player.zhanyi.doBeastFamBossFight(fightType)
    # else:
    return player.doZhangJie(fightType, bossGuanQia)
